/*==============================================================================
            Copyright (c) 2013 Moritz Hader, Marcel Schrder
            All Rights Reserved.

	@file  HeimdallMath.h

	@brief Header of the HeimdallMath.cpp file.
   
   This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

==============================================================================*/


#ifndef _HEIMDALLMATH_LIBRARY__
#define _HEIMDALLMATH_LIBRARY__

#include <math.h>
#include <string.h>
#include <limits.h>

typedef float H3DVector[3]; //Defines a 3-Dimensional Vector
typedef float H4DVector[4]; //Defines a 4-Dimensional Vector
typedef float H44DMatrix[16]; //Defines the 4x4 column major matrix

//To save calculation-time, we define PI and some of its common variations during compile-time
#define HD_PI (3.1415926535897932)
#define HD_2PI (2.0 * HD_PI)
#define HD_D2R (0.017453292519943296) //Degree to Radiant
#define HD_R2D (57.2957795130823229)

//Also some conversion methods
#define DegToRad(deg)	((deg)*HD_D2R)
#define RadToDeg(deg)	((deg)*HD_R2D)

//Other usefull constants
#define maxInteger (INT_MAX)

void H3DMatrixMultiply44(H44DMatrix product, const H44DMatrix a, const H44DMatrix b );
void MakeInitialMatrix(H44DMatrix);
void scaleMatrix(H44DMatrix matrix, H3DVector scale);
void rotateMatrix(H44DMatrix matrix, H3DVector rotate);
	void GenerateRotationMatrix(float angle, H3DVector axis, H44DMatrix matrix);
void translateMatrix(H44DMatrix matrix, H3DVector translate);

#endif
